import {
  defineConfig,
  presetUno,
  presetAttributify,
  transformerDirectives,
  transformerVariantGroup
} from 'unocss'

export default defineConfig({
  presets: [presetUno(), presetAttributify()],
  transformers: [transformerDirectives(), transformerVariantGroup()],
  shortcuts: [
    ['wh-full', 'w-full h-full'],
    ['ft', 'flex flex-col'],
    ['ftb', 'flex flex-col justify-between'],
    ['fr', 'flex flex-row-reverse'],
    ['frc', 'flex items-center flex-row-reverse'],
    ['fxc', 'flex justify-center'],
    ['fyc', 'flex items-center'],
    ['fb', 'flex justify-between'],
    ['fbc', 'flex justify-between items-center'],
    ['fcc', 'flex justify-center items-center'],
    ['ftcc', 'flex flex-col justify-center items-center'],
    ['ftxc', 'flex flex-col justify-center'],
    ['ftyc', 'flex flex-col items-center']
  ],
  rules: [[/^wh-(\d+px)$/, ([, d]) => ({ width: `${d}`, height: `${d}` })]],
  theme: {
    colors: {
      primary: '#1890ff',
      success: '#52c41a',
      warning: '#faad14',
      error: '#ff4d4f',
      'text-1': '#333',
      'text-2': '#666',
      'text-3': '#999'
    }
  }
})
